<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <script>
            function getVal(){
                var a=document.getElementById("a");//DOM对象

                //获取下拉列表选中项的值
                // console.log(a.options[a.selectedIndex].value);

                //获取下拉列表选中项的值
                // select的DOM对象.value
                console.log(a.value);

            }
        </script>
    </head>
    <body>
        <select  id="a" onchange="getVal()">
            <option value="haha">哈哈</option>
            <option value="heihei">嘿嘿</option>
            <option value="xixi">嘻嘻</option>
        </select>
    </body>
</html>